#ifndef __COMMON_H__
#define	__COMMON_H__

unsigned char hex_to_bcd(unsigned char hex);
unsigned char bcd_to_hex(unsigned char bcd);
void HexToBcdByInt(int hex, unsigned char*bcd, unsigned char bcdlen);
void HexToBcdByUint(unsigned int hex, unsigned char*bcd, unsigned char bcdlen);
void FloatToBcd(float flt, unsigned char decimal,unsigned char*bcd, unsigned char bcdlen);
unsigned int BcdToHex(const unsigned char *bcd, unsigned char len);
float BcdToFloat(const unsigned char *bcd, unsigned char len, unsigned char decimal);

void FloatToBigEndianInt(float fltval, unsigned char decimal,unsigned char *phex);
void FloatToBigEndianShort(float fltval, unsigned char decimal,unsigned char *phex);

unsigned int BigEndianToInt(const unsigned char *data, unsigned char len); 
float BigEndianToFloat(const unsigned char *data, unsigned char len, unsigned char decimal);
#endif


